import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
import LoginPage from '@/views/LoginPage/LoginPage.vue';

import user from './module/user';
import product from './module/product';

let moduleRouter = [user, product];

// 书写路由规则
let routes = [{
        path: '/',
        redirect: '/login'
    }, {
        path: '/login',
        component: LoginPage
    },
    ...moduleRouter
];

// 创建路由的实例
const router = new VueRouter({
    routes,
});

export default router;